import { Component, registerHooks } from "@/composables/useInjectHooks";
import { defineNuxtPlugin } from "#imports";

export interface HooksMapInst {
  replace?: Component;
  wrap: Component[];
  head: Component[];
  tail: Component[];
}

const hooks = new Map<string, HooksMapInst>();
if (import.meta.env.SSR) {
  global.__hooks = hooks;
  global.__registerHooks = registerHooks;
} else {
  window.__hooks = hooks;
  window.__registerHooks = registerHooks;
}

export default defineNuxtPlugin(() => {
  return;
});
